
package gui.panels;

import gui.MainFrame;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

/**
 *
 * @author JtR
 */
public class StatisticsPanel extends GuiPanel {
    private JTabbedPane tabbedPane;
    private ProfileContentPanel profile;
    private StatisticsContentPanel statistics;
    
    public StatisticsPanel(MainFrame parent) {
        super(parent, false, BackgroundType.BOTH);
    }
    
    @Override
    protected void initComponents() {
        tabbedPane = new JTabbedPane();
        constraints.weightx = 1;
        constraints.weighty = 1;
        constraints.fill = GridBagConstraints.BOTH;
        constraints.insets = new Insets(20, 20, 20, 20);
        add(tabbedPane, constraints);
        
        profile = new ProfileContentPanel();
        statistics = new StatisticsContentPanel();
        
        tabbedPane.add("<html><body leftmargin=15 topmargin=8 marginwidth=15 marginheight=5>Gesundheitsprofil</body></html>", profile);
        tabbedPane.add("<html><body leftmargin=15 topmargin=8 marginwidth=15 marginheight=5>Nutzerstatistik</body></html>", statistics);
        tabbedPane.setBackground(Color.WHITE);
    }

    @Override
    public String getDescription() {
        return "Sie befinden sich in Ihrem Profil";
    }

    @Override
    public void updateFields() {
        profile.updateFields();
        statistics.updateFields();
    }

    @Override
    public boolean getPreviousButtonEnabled() {
        return true;
    }

    @Override
    public boolean getNextButtonEnabled() {
        return false;
    }

    @Override
    public String getName() {
        return "STATISTICS_NAME";
    }

    @Override
    public GuiPanel getNextPanel() {
        throw new RuntimeException("Dieses Panel hat keinen Nachfolger");
    }

    @Override
    public GuiPanel getPreviousPanel() {
        return parent.previousPanel;
    }
}
